#include <Box2D.h>
#include "common.h"

#ifdef __cplusplus
extern "C" {
#endif

JNIEXPORT void JNICALL Java_b2WheelJointDef_jni_1b2WheelJointDef_1Initialize
  (JNIEnv *, jclass, 
	jint _localAnchorA, jint _localAnchorB, jint _localAxisA,
	jint _bodyA, jint _bodyB, jint _anchor, jint _axis)
{
	b2Body* bodyA = (b2Body*)_bodyA;
	b2Body* bodyB = (b2Body*)_bodyB;

	b2Vec2* localAnchorA = (b2Vec2*)_localAnchorA;
	b2Vec2* localAnchorB = (b2Vec2*)_localAnchorB;
	b2Vec2* localAxisA = (b2Vec2*)_localAxisA;

	b2Vec2* anchor = (b2Vec2*)_anchor;
	b2Vec2* axis = (b2Vec2*)_axis;

	*localAnchorA = bodyA->GetLocalPoint(*anchor);
	*localAnchorB = bodyB->GetLocalPoint(*anchor);
	*localAxisA = bodyA->GetLocalVector(*axis);
}

#ifdef __cplusplus
}
#endif
